<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddCommonUserInfoToUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->string('status', 50)->after('id')->default('正常');
            $table->string('role', 50)->after('status');
            $table->tinyInteger('is_email_verified')->after('email')->default(0);
            $table->string('tel', 100)->after('password');
            $table->string('work_org_name')->after('tel');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn('status');
            $table->dropColumn('role');
            $table->dropColumn('is_email_verified');
            $table->dropColumn('tel');
            $table->dropColumn('work_org_name');
        });
    }
}
